<template>
  <FrontSideTable
    dataUrl="/maintain/getMaintainBridgeDiseaseList"
    :dataParam="{taskId:bridge.taskId, bridgeId:bridge.id}"
    :tableTitle="bridge.name + '病害列表'"
    :columns="columns"
    :searchProps="searchProps"
    @onBack="handleBack"
    :addable="false"
    customButton
    customFormDialog
    canBack>

    <!--照片展开-->
    <template slot="beforeColumns">
      <el-table-column type="expand">
        <template slot-scope="scope">
          <DiseasePhotoWall
            imageUrl="/maintain/getDiseasePhoto"
            thumbnailUrl="/maintain/getDiseaseThumbnail"
            :defaultList = "scope.row.diseasePhotoList"
            :canOperate="false">
          </DiseasePhotoWall>
        </template>
      </el-table-column>
    </template>

    <!--选择处治措施-->
    <template slot="afterColumns">
      <el-table-column align="center" width="250" label="处治措施">
        <template slot-scope="scope">
          <el-select v-model="scope.row.treatmentId" @change="handleTreatmentChange(scope.row)" clearable>
            <el-option
              v-for="item of scope.row.diseaseTreatmentList"
              :key="item.id"
              :label="item.treatmentName"
              :value="item.treatmentId">
            </el-option>
          </el-select>
        </template>
      </el-table-column>
    </template>
  </FrontSideTable>
</template>

<script>
  import FrontSideTable from "../template/FrontSideTable.vue"
  import DiseasePhotoWall from "../template/DiseasePhotoWall.vue"

  export default {
    name:"MaintainBridgeDisease",
    props:{
      bridge:{
        type:Object,
        required:true
      }
    },
    data() {
      return {
        columns:[
          {prop:"sideTypeName", label:"分幅", width:"100"},
          {prop:"siteNo", label:"孔号", width:"150", sortable:true},
          {prop:"bridgeMemberName", label:"构件", width:"150"},
          {prop:"bridgeDiseaseName", label:"病害描述"},
          {prop:"deductionScale", label:"标度", width:"100", filters:[{text:"标度1", value:1},{text:"标度2", value:2},{text:"标度3", value:3},{text:"标度4", value:4},{text:"标度5", value:5},{text:"重点关注", value:0}]}
        ],
        searchProps:["sideTypeName", "bridgeMemberName", "bridgeDiseaseName"]
      }
    },
    methods:{
      handleBack() {
        this.$emit("onBack");
      },
      handleTreatmentChange(data) {
      }
    },
    components:{FrontSideTable, DiseasePhotoWall}
  }
</script>



// WEBPACK FOOTER //
// MaintainBridgeDisease.vue?26c63a34
